<link href="Style.css" rel="stylesheet" type="text/css" />
<?php
session_start(); 

require("sql_functions.php");

if(isset($_SESSION['user']))
{
	$user = $_SESSION['user'];
	
	if( isset($_GET['email']) )
	{		    
		$emp = sql_getEmployee($_GET['email']);
    
    $email = $emp['Email'];
    $name = $emp['FirstName'] . ' ' . $emp['LastName'];
    
    if($email)
    {   
      $certs = sql_getEmployeeCertifications($email);
      echo "<html>"; 
	    echo "<head>"; 
	    echo "</head>"; 
	    echo "<body>";
	    echo "<p>View Employee"; 
      echo "<p>$name";
	    echo "<p>Email: $email";
      echo "<p>Certifications:";
    	
      if(mysql_num_rows($certs) == 0)
	    { 
        echo "<p>None";
      }
      else
      {
      
	      while($row = mysql_fetch_array($certs))
	      {		
          $cert = $row['Certification'];
          echo "<p>$cert";
	      }
      }
 
      echo "<form><input type=\"button\" value=\"Back\" onClick=\"history.go(-1)\"></form>";
  
	    echo "</body>"; 
	    echo "</html>"; 
    }
    else
    {
      echo "Invalid Employee";
    }
    
    
	}
	
	else
	{
		echo "Invalid Employee";
	}
}
else
{
	echo "Must be logged in to view this page.";
}

?>




